package xq.gwt.ui.widgets.command;

import java.util.ArrayList;


import com.smartgwt.client.widgets.tree.TreeNode;

public class ObservableTreeNode extends TreeNode{
	ArrayList<TreeNodeClickedListener> listeners = new ArrayList<TreeNodeClickedListener>();
	
	public void addTreeNodeClickedListener(TreeNodeClickedListener listener){
		listeners.add(listener);
	}
	
	public void removeTreeNodeClickedListener(TreeNodeClickedListener listener){
		listeners.add(listener);
	}
	
	protected void notifyTreeNodeClickedListeners() {
		for (TreeNodeClickedListener listener : listeners) {
			listener.treeNodeClicked();
		}
	}
	
	public void doClick(){
		notifyTreeNodeClickedListeners();
	}
}
